<style scoped lang="less"></style>
<template>
    <div class="trace-details">
        <!-- <h3><i class="icongont icon-info"></i> 基本信息</h3> -->
        <div class="trace-detail mt-10">
            <p>隐患描述：{{ data.des || "-" }}</p>
            <p>发现时间：{{ data.findtime || "-" }}</p>
            <p>隐患等级：{{ data.gradeName || "-" }}</p>
            <p>状态：{{ data.stateName || "-" }}</p>
            <p>RFID码：{{ data.rfid || "-" }}</p>
            <p v-if="imgList.length == 0">处理图片：暂无</p>
            <template v-else>
                <p style="display:flex;align-items:flex-start;flex-wrap:wrap">
                    处理图片：
                    <img
                        :src="item"
                        alt=""
                        style="width:200px;margin-right:10px"
                        v-for="(item, index) in imgList"
                        :key="index"
                    />
                </p>
            </template>
        </div>
    </div>
</template>
<script>
import PlanDetail from "@/components/census/PlanDetail.vue"
export default {
    name: "TraceDetail",
    props: {
        activeData: {
            type: Object,
            default() {
                return {}
            },
        },
    },
    components: {
        PlanDetail,
    },
    watch: {},
    data() {
        return {
            data: {},
            loading: false,
        }
    },
    computed: {
        imgList() {
            if (this.activeData.img) {
                return this.activeData.img.split(",")
            }
            return []
        },
    },
    methods: {
        getData() {
            this.openFullLoading()
            this.$get("/check/hiddendanger/detail", {
                id: this.activeData.id,
            }).then(
                (res) => {
                    this.closeFullLoading()
                    this.data = res.data
                },
                (err) => {
                    this.closeFullLoading()
                    this.$message.error(err.msg)
                }
            )
        },
    },
    created() {
        this.getData()
    },
}
</script>
